{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "Plotly"
   ]
  },
  {
   "cell_type": "code",
   "metadata": {
    "jupyter": {
     "is_executing": true
    }
   },
   "source": [
    "# 两种绘图接口\n",
    "import plotly_express as px  # import plotly.express as px\n",
    "import plotly.graph_objects as go\n",
    "\n",
    "df = px.data.iris()   # 鸢尾花数据集\n",
    "df.head()\n",
    "\n",
    "fig = px.scatter(\n",
    "df,  # 数据集\n",
    "x=\"sepal_width\",  # x轴\n",
    "y=\"sepal_length\",  # y轴\n",
    "color=\"sepal_length\"  # 指定颜色\n",
    ")\n",
    "fig.show()\n"
   ],
   "outputs": [],
   "execution_count": null
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "base",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.12.4"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
